#lang rosetta-racket


(provide cup)


(define (rectangle-line p1 p2 p3 p4)
  (join
   (spline p1 p2)
   (spline p2 p3)
   (spline p3 p4)
   (spline p4 p1)))

(define (cup c p1 p2 p3 p4 radius)
  (loft
   (rectangle-line p1 p2 p3 p4)
   (move-z (* 0.1 radius) (circle c radius))
   (move-z (* 0.8 radius) (circle c (* 0.7 radius)))
   (circle c (* 0.4 radius))))